home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mintmant / dcntl.txt < prev    next >
Text File  |  1992-03-24  |  5KB  |  130 lines

  1. Dcntl(2)                  Dec. 12, 1991                  Dcntl(2)
  2.  
  3.  
  4.  
  5. NAME
  6.      Dcntl - perform a file system specific operation on  a  file
  7.      or directory
  8.  
  9. SYNOPSIS
  10.      #include <filesys.h>
  11.  
  12.      LONG Dcntl( WORD cmd, char *name, LONG arg);
  13.  
  14. DESCRIPTION
  15.      Dcntl performs a file system specific command, given by cmd,
  16.      upon  the  file  or  directory specified by name.  The exact
  17.      nature of the operation performed depends upon the file sys-
  18.      tem  on  which name resides. The interpretation of the third
  19.      argument arg depends upon the specific command.
  20.  
  21.      The only built-in file system which  supports  Dcntl  opera-
  22.      tions  is  the  device file system U:\DEV, which understands
  23.      the following commands:
  24.  
  25.  
  26.      DEV_INSTALL
  27.           Installs a new device driver whose  name  is  given  by
  28.           name  (which  must  be the complete path and file name,
  29.           e.g.  U:\DEV\FOO). The  device  may  be  accessed  only
  30.           through  GEMDOS  file  operations; the BIOS will not be
  31.           aware of it.  arg is a pointer to a  device  descriptor
  32.           structure:
  33.  
  34.           struct dev_descr {
  35.            /* pointer to device driver structure */
  36.                DEVDRV    *driver;
  37.            /* placed in the "aux" field of file cookies */
  38.                short     dinfo;
  39.            /* either 0 or O_TTY */
  40.                short     flags;
  41.            /* if flags&O_TTY, this points to the tty structure associated
  42.             * with the device
  43.             */
  44.                struct tty *tty;
  45.            /* reserved for future expansion -- set to 0 */
  46.                long reserved[4];
  47.           };
  48.  
  49.           If the attempt to install  the  device  is  successful,
  50.           Dcntl  will  return  a pointer to a structure with type
  51.           "struct kerinfo" that describes  the  kernel  (see  the
  52.           documentation for loadable file systems for more infor-
  53.           mation on this structure). This structure  is  in  pro-
  54.           tected  memory  and  can be accessed only in supervisor
  55.           mode. Moreover, the structure is read only; attempts to
  56.           write  to  it  will  produce  unpredictable errors.  If
  57.  
  58.  
  59.  
  60. Version 0.92  Last change: MiNT Programmer's Manual             1
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. Dcntl(2)                  Dec. 12, 1991                  Dcntl(2)
  68.  
  69.  
  70.  
  71.           there is not enough memory to install the new device, a
  72.           null pointer will be returned.
  73.  
  74.      DEV_NEWTTY
  75.           Installs a driver for a new BIOS terminal device  whose
  76.           name  is  name  (this  must be the full path name, e.g.
  77.           U:\DEV\BAR).  arg is the BIOS  device  number  of  this
  78.           device.  Note  that  the BIOS must have been told about
  79.           the device already via the Bconmap system call or  some
  80.           similar mechanism; otherwise, any attempt to access the
  81.           file will result in an unknown device  error  (EUNDEV).
  82.           This  command  simply  informs  the kernel about a BIOS
  83.           device that already exists,  unlike  DEV_INSTALL  which
  84.           actually creates a new device.
  85.  
  86.  
  87.      DEV_NEWBIOS
  88.           Installs a driver for a new  BIOS  non-terminal  device
  89.           whose  name  is  name (this must be the full path name,
  90.           e.g.  U:\DEV\BAR).  arg is the BIOS  device  number  of
  91.           this  device.  Note  that  the BIOS must have been told
  92.           about the device already via the Bconmap system call or
  93.           some  similar  mechanism;  otherwise,  any  attempt  to
  94.           access the file will result in an unknown device  error
  95.           (EUNDEV).  Like  DEV_NEWTTY,  this  command informs the
  96.           kernel of the existence of a BIOS device.  The  differ-
  97.           ence between the two commands is that DEV_NEWTTY should
  98.           be used for devices which may be used as terminal  dev-
  99.           ices (e.g. serial lines), whereas DEV_NEWBIOS is useful
  100.           for devices for which data must be  always  transmitted
  101.           "raw"  (e.g.  a SCSI tape device, or perhaps a LAN dev-
  102.           ice).
  103.  
  104.  
  105. RETURNS
  106.      The  value  returned  depends  on  the  specific   operation
  107.      requested  and  the  file system involved. Generally, a 0 or
  108.      positive return value should mean success,  and  a  negative
  109.      one   failure.   An  exception  is  the  value  returned  by
  110.      DEV_INSTALL, which is either a pointer to a kernel  informa-
  111.      tion structure, or null on failure.
  112.  
  113. SEE ALSO
  114.      Bconmap(2), Fcntl(2)
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126. Version 0.92  Last change: MiNT Programmer's Manual             2
  127.  
  128.  
  129.  
  130.